<?php
/**
 * Created by PhpStorm.
 * User: 1
 * Date: 2016-11-24
 * Time: 18:04
 */

namespace app\src\user\action;


use app\src\base\action\BaseAction;
use think\Db;
use think\Exception;

class QueryAction extends BaseAction
{
    public function queryCustomer($group_id){
        try{

            $result = Db::table("itboye_ucenter_member")->alias("uc")
                ->field("uc.id as uid,mc.alibaichuan_id as alibaichuan_uid,m.nickname")
                ->join(["common_member"=>"m"],"m.uid = uc.id","LEFT")
                ->join(["itboye_member_config"=>"mc"],"mc.uid = uc.id","LEFT")
                ->join(["common_auth_group_access"=>"aga"],"aga.uid = uc.id","LEFT")
                ->where("aga.group_id",$group_id)
            ->select();
            return $this->success($result);
        }catch (Exception $ex){
            return $this->error($ex->getMessage());
        }
    }
}